home *** CD-ROM | disk | FTP | other *** search
/ CD/PC Actual 76 / DVD Actual 1 Marzo 2003.iso / Trial / TurboCAD 7.1 Pro / Data.Cab / F24351_LTSample.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-11-10  |  2.6 KB  |  98 lines

  1. // LTSample.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "LTSample.h"
  6. #include "VpWnd.h"
  7. #include "LTSampleDlg.h"
  8.  
  9. #ifdef _DEBUG
  10. #define new DEBUG_NEW
  11. #undef THIS_FILE
  12. static char THIS_FILE[] = __FILE__;
  13. #endif
  14.  
  15. /////////////////////////////////////////////////////////////////////////////
  16. // CLTSampleApp
  17.  
  18. BEGIN_MESSAGE_MAP(CLTSampleApp, CWinApp)
  19.     //{{AFX_MSG_MAP(CLTSampleApp)
  20.         // NOTE - the ClassWizard will add and remove mapping macros here.
  21.         //    DO NOT EDIT what you see in these blocks of generated code!
  22.     //}}AFX_MSG
  23.     ON_COMMAND(ID_HELP, CWinApp::OnHelp)
  24. END_MESSAGE_MAP()
  25.  
  26. /////////////////////////////////////////////////////////////////////////////
  27. // CLTSampleApp construction
  28.  
  29. CLTSampleApp::CLTSampleApp()
  30. {
  31.     // TODO: add construction code here,
  32.     // Place all significant initialization in InitInstance
  33. }
  34.  
  35. /////////////////////////////////////////////////////////////////////////////
  36. // The one and only CLTSampleApp object
  37.  
  38. CLTSampleApp theApp;
  39.  
  40. /////////////////////////////////////////////////////////////////////////////
  41. // CLTSampleApp initialization
  42.  
  43. BOOL CLTSampleApp::InitInstance()
  44. {
  45.     // Initialize OLE libraries
  46.     if (!AfxOleInit())
  47.     {
  48.         AfxMessageBox(IDP_OLE_INIT_FAILED);
  49.         return FALSE;
  50.     }
  51.  
  52.     AfxEnableControlContainer();
  53.  
  54.     // Standard initialization
  55.     // If you are not using these features and wish to reduce the size
  56.     //  of your final executable, you should remove from the following
  57.     //  the specific initialization routines you do not need.
  58.  
  59. #ifdef _AFXDLL
  60.     Enable3dControls();            // Call this when using MFC in a shared DLL
  61. #else
  62.     Enable3dControlsStatic();    // Call this when linking to MFC statically
  63. #endif
  64.  
  65.     // Parse the command line to see if launched as OLE server
  66.     if (RunEmbedded() || RunAutomated())
  67.     {
  68.         // Register all OLE server (factories) as running.  This enables the
  69.         //  OLE libraries to create objects from other applications.
  70.         COleTemplateServer::RegisterAll();
  71.     }
  72.     else
  73.     {
  74.         // When a server application is launched stand-alone, it is a good idea
  75.         //  to update the system registry in case it has been damaged.
  76.         COleObjectFactory::UpdateRegistryAll();
  77.     }
  78.  
  79.     CLTSampleDlg dlg;
  80.     m_pMainWnd = &dlg;
  81.     int nResponse = dlg.DoModal();
  82.     if (nResponse == IDOK)
  83.     {
  84.         // TODO: Place code here to handle when the dialog is
  85.         //  dismissed with OK
  86.     }
  87.     else if (nResponse == IDCANCEL)
  88.     {
  89.         // TODO: Place code here to handle when the dialog is
  90.         //  dismissed with Cancel
  91.     }
  92.  
  93.     // Since the dialog has been closed, return FALSE so that we exit the
  94.     //  application, rather than start the application's message pump.
  95.     return FALSE;
  96. }
  97.  
  98.